Add new MinimalVideoPlayer component - #1425
Conversation
🦋 Changeset detectedLatest commit: 6bedd99 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🟢 No design token changes found |
🟢 Bundle size report
|
🟢 Unit test coverage changes foundUnit test coverage has been updated through this PR. Changes: 1 new tests, 0 removed tests, 0 improved, 0 decreased
|
|
There was a problem hiding this comment.
Pull request overview
Adds a new MinimalVideoPlayer React component to @primer/react-brand for muted, inline, minimal-control video playback with viewport-aware autoplay and reduced-motion support, and integrates it into the FlexSuite AI Overview hero media.
Changes:
- Introduces
MinimalVideoPlayer(component, styles, hook) with viewport-based autoplay/pause/resume and reduced-motion handling. - Adds unit tests, Storybook stories, and visual snapshots/tests for the new component.
- Updates FlexSuite AI Overview to use the new video component (plus localized play/pause strings) and stabilizes related visual tests via reduced-motion emulation.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/recipes/Flexsuite/Overview/Overview.visual.spec.ts | Emulates reduced motion to keep the AI Overview visual snapshot stable with video media. |
| packages/react/src/recipes/Flexsuite/Overview/FlexSuiteAIOverview.tsx | Swaps hero image for hero video using MinimalVideoPlayer. |
| packages/react/src/recipes/Flexsuite/Overview/FlexSuiteAIOverview.content.ts | Adds localized play/pause strings for the new hero video control labels. |
| packages/react/src/MinimalVideoPlayer/useMinimalVideoPlayback.ts | Implements viewport-aware autoplay/pausing and reduced-motion behavior. |
| packages/react/src/MinimalVideoPlayer/MinimalVideoPlayer.visual.spec.ts | Visual regression coverage for paused/narrow stories. |
| packages/react/src/MinimalVideoPlayer/MinimalVideoPlayer.tsx | New component implementation (muted, inline, hidden native controls, overlay play/pause button). |
| packages/react/src/MinimalVideoPlayer/MinimalVideoPlayer.test.tsx | Unit + a11y tests covering autoplay, viewport behavior, reduced motion, and event handler passthrough. |
| packages/react/src/MinimalVideoPlayer/MinimalVideoPlayer.stories.tsx | Default + Playground stories for Storybook controls. |
| packages/react/src/MinimalVideoPlayer/MinimalVideoPlayer.module.css.d.ts | Generated CSS module typings for the new component. |
| packages/react/src/MinimalVideoPlayer/MinimalVideoPlayer.module.css | Styles for layout and the overlay control (including forced-colors handling). |
| packages/react/src/MinimalVideoPlayer/MinimalVideoPlayer.features.stories.tsx | Feature stories (native <source>, paused/playing, custom labels, narrow viewport). |
| packages/react/src/MinimalVideoPlayer/index.ts | Public barrel export for the new component. |
| packages/react/src/index.ts | Exposes MinimalVideoPlayer from the package root. |
| packages/e2e/scripts/playwright/playwright.generate-tests.ts | Adjusts visual test generation: reduced-motion overrides + skips for nondeterministic/autoplaying stories. |
| apps/storybook/static/locales/pt-BR/FlexSuiteOverview.json | Adds localized play/pause labels for FlexSuite Overview hero video controls. |
| apps/storybook/static/locales/ja/FlexSuiteOverview.json | Adds localized play/pause labels for FlexSuite Overview hero video controls. |
| apps/storybook/static/locales/fr/FlexSuiteOverview.json | Adds localized play/pause labels for FlexSuite Overview hero video controls. |
| apps/storybook/static/locales/es/FlexSuiteOverview.json | Adds localized play/pause labels for FlexSuite Overview hero video controls. |
| apps/storybook/static/locales/en/FlexSuiteOverview.json | Adds localized play/pause labels for FlexSuite Overview hero video controls. |
| apps/storybook/static/locales/de/FlexSuiteOverview.json | Adds localized play/pause labels for FlexSuite Overview hero video controls. |
| apps/next-docs/content/components/MinimalVideoPlayer/index.mdx | Adds documentation page with usage and accessibility guidance. |
| .changeset/calm-videos-play.md | Changeset announcing the new component in @primer/react-brand (minor). |
Review details
- Files reviewed: 21/28 changed files
- Comments generated: 3
- Review effort level: Low
There was a problem hiding this comment.
@jesussandreas, please note that we are still using the old play icon here. It will be automatically replaced by the new one you provided as soon as Octicons is updated and we upgrade the dependency in Primer Brand.
|
|
||
| const defaultTimeout = 500 // Storybook 7 introduced a small delay in loading stories. This is to migigate the spinner showing up in screenshots. | ||
|
|
||
| const reducedMotionLookup = [ |
There was a problem hiding this comment.
Note for posterity, this should be done using NODE_ENV with a test value. That'll swap out the video with a static poster for VRT.
…-minimal-video-player-component

Summary
Resolves https://github.com/github/brand-experience/issues/383
Resolves #1437
Adds
MinimalVideoPlayer, a lightweight component for short, silent videos (illustrations, product demos) that only need a play and pause control.The component is always muted, plays inline, and hides native video controls. Automatic playback is viewport-aware and respects reduced-motion preferences.
List of notable changes:
MinimalVideoPlayercomponentWhat should reviewers focus on?
Steps to test:
MinimalVideoPlayerpage in the Next.js docs preview.Contributor checklist:
update snapshotslabel to the PR)Reviewer checklist:
Screenshots: